﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using TwitterClient2.Controller;

namespace TwitterClient2.Components
{
    class Mainmenu : Panel
    {
        private TwitterClientController controller = TwitterClientController.getInstance();
        private ImageButton searchButton;
        private ImageButton messagesButton;
        private ImageButton newsButton;
        private ImageButton followersButton;
        private ImageButton friendsButton;
        private Label labelFollowers;
        private Label labelNews;
        private Label labelMessages;
        private Label labelHome;
        private Label labelSearch;
        private Label labelFriends;
        private ImageButton homeButton;

        public Mainmenu()
        {
            InitializeComponent();
        }
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Mainmenu));
            this.labelFollowers = new System.Windows.Forms.Label();
            this.homeButton = new TwitterClient2.Components.ImageButton();
            this.searchButton = new TwitterClient2.Components.ImageButton();
            this.messagesButton = new TwitterClient2.Components.ImageButton();
            this.newsButton = new TwitterClient2.Components.ImageButton();
            this.followersButton = new TwitterClient2.Components.ImageButton();
            this.friendsButton = new TwitterClient2.Components.ImageButton();
            this.labelNews = new System.Windows.Forms.Label();
            this.labelMessages = new System.Windows.Forms.Label();
            this.labelHome = new System.Windows.Forms.Label();
            this.labelSearch = new System.Windows.Forms.Label();
            this.labelFriends = new System.Windows.Forms.Label();
            this.SuspendLayout();
            // 
            // labelFollowers
            // 
            this.labelFollowers.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
            this.labelFollowers.Location = new System.Drawing.Point(40, 246);
            this.labelFollowers.Name = "labelFollowers";
            this.labelFollowers.Size = new System.Drawing.Size(60, 20);
            this.labelFollowers.Text = "Followers";
            this.labelFollowers.TextAlign = System.Drawing.ContentAlignment.TopCenter;
            // 
            // homeButton
            // 
            this.homeButton.Location = new System.Drawing.Point(40, 22);
            this.homeButton.MousePressedImage = ((System.Drawing.Image)(resources.GetObject("homeButton.MousePressedImage")));
            this.homeButton.Name = "homeButton";
            this.homeButton.NormalImage = ((System.Drawing.Image)(resources.GetObject("homeButton.NormalImage")));
            this.homeButton.Size = new System.Drawing.Size(60, 60);
            this.homeButton.TabIndex = 0;
            this.homeButton.Text = "homeButton";
            this.homeButton.Click += new System.EventHandler(this.buttonClick);
            // 
            // searchButton
            // 
            this.searchButton.Location = new System.Drawing.Point(140, 22);
            this.searchButton.MousePressedImage = ((System.Drawing.Image)(resources.GetObject("searchButton.MousePressedImage")));
            this.searchButton.Name = "searchButton";
            this.searchButton.NormalImage = ((System.Drawing.Image)(resources.GetObject("searchButton.NormalImage")));
            this.searchButton.Size = new System.Drawing.Size(60, 60);
            this.searchButton.TabIndex = 0;
            this.searchButton.Text = "imageButton1";
            this.searchButton.Click += new System.EventHandler(this.buttonClick);
            // 
            // messagesButton
            // 
            this.messagesButton.Location = new System.Drawing.Point(40, 104);
            this.messagesButton.MousePressedImage = ((System.Drawing.Image)(resources.GetObject("messagesButton.MousePressedImage")));
            this.messagesButton.Name = "messagesButton";
            this.messagesButton.NormalImage = ((System.Drawing.Image)(resources.GetObject("messagesButton.NormalImage")));
            this.messagesButton.Size = new System.Drawing.Size(60, 60);
            this.messagesButton.TabIndex = 0;
            this.messagesButton.Text = "messages";
            this.messagesButton.Click += new System.EventHandler(this.buttonClick);
            // 
            // newsButton
            // 
            this.newsButton.Location = new System.Drawing.Point(140, 104);
            this.newsButton.MousePressedImage = ((System.Drawing.Image)(resources.GetObject("newsButton.MousePressedImage")));
            this.newsButton.Name = "newsButton";
            this.newsButton.NormalImage = ((System.Drawing.Image)(resources.GetObject("newsButton.NormalImage")));
            this.newsButton.Size = new System.Drawing.Size(60, 60);
            this.newsButton.TabIndex = 0;
            this.newsButton.Text = "news";
            this.newsButton.Click += new System.EventHandler(this.buttonClick);
            // 
            // followersButton
            // 
            this.followersButton.Location = new System.Drawing.Point(40, 186);
            this.followersButton.MousePressedImage = ((System.Drawing.Image)(resources.GetObject("followersButton.MousePressedImage")));
            this.followersButton.Name = "followersButton";
            this.followersButton.NormalImage = ((System.Drawing.Image)(resources.GetObject("followersButton.NormalImage")));
            this.followersButton.Size = new System.Drawing.Size(60, 60);
            this.followersButton.TabIndex = 0;
            this.followersButton.Text = "followers";
            this.followersButton.Click += new System.EventHandler(this.buttonClick);
            // 
            // friendsButton
            // 
            this.friendsButton.Location = new System.Drawing.Point(140, 186);
            this.friendsButton.MousePressedImage = ((System.Drawing.Image)(resources.GetObject("friendsButton.MousePressedImage")));
            this.friendsButton.Name = "friendsButton";
            this.friendsButton.NormalImage = ((System.Drawing.Image)(resources.GetObject("friendsButton.NormalImage")));
            this.friendsButton.Size = new System.Drawing.Size(60, 60);
            this.friendsButton.TabIndex = 0;
            this.friendsButton.Text = "friends";
            this.friendsButton.Click += new System.EventHandler(this.buttonClick);
            // 
            // labelNews
            // 
            this.labelNews.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
            this.labelNews.Location = new System.Drawing.Point(140, 164);
            this.labelNews.Name = "labelNews";
            this.labelNews.Size = new System.Drawing.Size(60, 20);
            this.labelNews.Text = "News";
            this.labelNews.TextAlign = System.Drawing.ContentAlignment.TopCenter;
            // 
            // labelMessages
            // 
            this.labelMessages.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
            this.labelMessages.Location = new System.Drawing.Point(40, 164);
            this.labelMessages.Name = "labelMessages";
            this.labelMessages.Size = new System.Drawing.Size(60, 20);
            this.labelMessages.Text = "Messages";
            this.labelMessages.TextAlign = System.Drawing.ContentAlignment.TopCenter;
            // 
            // labelHome
            // 
            this.labelHome.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
            this.labelHome.Location = new System.Drawing.Point(40, 82);
            this.labelHome.Name = "labelHome";
            this.labelHome.Size = new System.Drawing.Size(60, 20);
            this.labelHome.Text = "Home";
            this.labelHome.TextAlign = System.Drawing.ContentAlignment.TopCenter;
            // 
            // labelSearch
            // 
            this.labelSearch.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
            this.labelSearch.Location = new System.Drawing.Point(140, 82);
            this.labelSearch.Name = "labelSearch";
            this.labelSearch.Size = new System.Drawing.Size(60, 20);
            this.labelSearch.Text = "Search";
            this.labelSearch.TextAlign = System.Drawing.ContentAlignment.TopCenter;
            // 
            // labelFriends
            // 
            this.labelFriends.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
            this.labelFriends.Location = new System.Drawing.Point(140, 246);
            this.labelFriends.Name = "labelFriends";
            this.labelFriends.Size = new System.Drawing.Size(60, 20);
            this.labelFriends.Text = "Friends";
            this.labelFriends.TextAlign = System.Drawing.ContentAlignment.TopCenter;
            // 
            // Mainmenu
            // 
            this.BackColor = System.Drawing.Color.White;
            this.Controls.Add(this.homeButton);
            this.Controls.Add(this.searchButton);
            this.Controls.Add(this.messagesButton);
            this.Controls.Add(this.newsButton);
            this.Controls.Add(this.followersButton);
            this.Controls.Add(this.friendsButton);
            this.Controls.Add(this.labelFollowers);
            this.Controls.Add(this.labelFriends);
            this.Controls.Add(this.labelHome);
            this.Controls.Add(this.labelNews);
            this.Controls.Add(this.labelSearch);
            this.Controls.Add(this.labelMessages);
            this.Size = new System.Drawing.Size(240, 268);
            this.ResumeLayout(false);

        }

        private void buttonClick(object sender, EventArgs e)
        {
            if (sender == this.homeButton)
                this.controller.performUserInput(TwitterClientController.MAINMENU_HOME_BUTTON_CLICK, null);
            else if (sender == this.searchButton)
                this.controller.performUserInput(TwitterClientController.MAINMENU_SEARCH_BUTTON_CLICK, null);
            else if (sender == this.followersButton)
                this.controller.performUserInput(TwitterClientController.MAINMENU_FOLLOWERS_CLICK, null);
            else if (sender == this.friendsButton)
                this.controller.performUserInput(TwitterClientController.MAINMENU_FRIENDS_BUTTON_CLICK, null);
            else if (sender == this.messagesButton)
                this.controller.performUserInput(TwitterClientController.MAINMENU_MESSAGES_BUTTON_CLICK, null);
            else if (sender == this.newsButton)
                this.controller.performUserInput(TwitterClientController.MAINMENU_NEWS_CLICK, null);
        }



    }
}
